<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="main" style="width: 600px;height:400px;"></div>
</body>
	<script type="text/javascript" src="Js/echarts.min.js"></script>
	<script type="text/javascript" src="Js/jquery.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			alert("222");
			$.ajax({
				url:"statistics2",
				type:"get",
				success:function(qqq){
					 // 基于准备好的dom，初始化echarts实例
			        var myChart = echarts.init(document.getElementById('main'));
					alert(qqq);
			        // 指定图表的配置项和数据
			        var option = {
		        	    title: {
		        	        text: '折线图堆叠'
		        	    },
		        	    tooltip: {
		        	        trigger: 'axis'
		        	    },
		        	    legend: {
		        	        data:['骨科','妇科','急诊科','脑科','血液科']
		        	    },
		        	    grid: {
		        	        left: '3%',
		        	        right: '4%',
		        	        bottom: '3%',
		        	        containLabel: true
		        	    },
		        	    toolbox: {
		        	        feature: {
		        	            saveAsImage: {}
		        	        }
		        	    },
		        	    xAxis: {
		        	        type: 'category',
		        	        boundaryGap: false,
		        	        data: ['周一','周二','周三','周四','周五','周六','周日']
		        	    },
		        	    yAxis: {
		        	        type: 'value'
		        	    },
		        	    series: [
		        	        {
		        	            name:'骨科',
		        	            type:'line',
		        	            // stack: '总量',
		        	            data:qqq[0]
		        	        },
		        	        {
		        	            name:'妇科',
		        	            type:'line',
		        	            // stack: '总量',
		        	            data:qqq[1]
		        	        },
		        	        {
		        	            name:'急诊科',
		        	            type:'line',
		        	            // stack: '总量',
		        	            data:qqq[2]
		        	        },
		        	        {
		        	            name:'脑科',
		        	            type:'line',
		        	            // stack: '总量',
		        	            data:qqq[3]
		        	        },
		        	        {
		        	            name:'血液科',
		        	            type:'line',
		        	            // stack: '总量',
		        	            data:qqq[4]
		        	        }
		        	    ]
			        };

			        // 使用刚指定的配置项和数据显示图表。
			        myChart.setOption(option);
				},
				error:function(){
					alert("服务器正忙,请稍后再试")
				}
				
			})
		});
	</script>
</html>